<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<title>${SYSTEM_NAME}</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
</head>
<body>
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-body" style="padding: 15px;">
		<form class="layui-form" method="post" id="basicform" >
			<input id="id" name="id" value="${generatorField.id }" type="hidden">
			
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">列名称</label>
				<div class="layui-input-block">
					<input name="columnName" placeholder="请输入列名称"
						   class="layui-input" lay-verify="required" value="${generatorField.columnName }" maxlength="100">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">列类型</label>
				<div class="layui-input-block">
					<input name="columnType" placeholder="请输入列类型"
						   class="layui-input" lay-verify="required" value="${generatorField.columnType }" maxlength="100">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">列长度1</label>
				<div class="layui-input-block">
					<input name="columnLength1" placeholder="请输入列长度1"
						   class="layui-input" lay-verify="number" value="${generatorField.columnLength1 }" maxlength="10">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">列长度2</label>
				<div class="layui-input-block">
					<input name="columnLength2" placeholder="请输入列长度2"
						   class="layui-input" lay-verify="number" value="${generatorField.columnLength2 }" maxlength="10">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">列排序</label>
				<div class="layui-input-block">
					<input name="ordinalPosition" placeholder="请输入列长度2"
						   class="layui-input" lay-verify="number" value="${generatorField.ordinalPosition }" maxlength="10">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">字段名称</label>
				<div class="layui-input-block">
					<input name="fieldName" placeholder="请输入字段名称"
						   class="layui-input" lay-verify="required" value="${generatorField.fieldName }" maxlength="100">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">字段类型</label>
				<div class="layui-input-block">
					<input name="fieldType" placeholder="请输入字段类型"
						   class="layui-input" lay-verify="required" value="${generatorField.fieldType }" maxlength="100">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">字段注释</label>
				<div class="layui-input-block">
					<input name="columnComment" placeholder="请输入字段类型"
						   class="layui-input" lay-verify="required" value="${generatorField.columnComment }" maxlength="100">
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">输入框类型</label>
				<div class="layui-input-inline">
					<select  lay-verify="required" name="inputType">
						<c:forEach items="${inputTypeMap}" var="t">
							<option value="${t.key }" <c:if test="${t.key eq generatorField.inputType}">selected="selected"</c:if>>${t.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">输入框必填</label>
				<div class="layui-input-inline">
					<select  lay-verify="required" name="required">
						<c:forEach items="${requiredMap}" var="t">
							<option value="${t.key }" <c:if test="${t.key eq generatorField.required}">selected="selected"</c:if>>${t.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">系统参数</label>
				<div class="layui-input-inline">
					<select  name="paramName">
						<option value="">请选择系统参数</option>
						<c:forEach items="${sysParamMap}" var="t">
							<option value="${t.key }" <c:if test="${t.key eq generatorField.paramName}">selected="selected"</c:if>>${t.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">LIST是否显示</label>
				<div class="layui-input-inline">
					<select  lay-verify="required" name="listShow">
						<c:forEach items="${yesNoMap}" var="t">
							<option value="${t.key }" <c:if test="${t.key eq generatorField.listShow}">selected="selected"</c:if>>${t.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>

			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label layui-form-required">是否查询列</label>
				<div class="layui-input-inline">
					<select  lay-verify="required" name="isQuery">
						<c:forEach items="${yesNoMap}" var="t">
							<option value="${t.key }" <c:if test="${t.key eq generatorField.isQuery}">selected="selected"</c:if>>${t.value }</option>
						</c:forEach>
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn layui-btn-primary layui-border-blue" lay-submit="" lay-filter="sub">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-border-blue">重置</button>
					<button type="button" class="layui-btn layui-btn-primary layui-border-red" onclick="closed()">关闭</button>
				</div>
			</div>
		</form>
	</div>
	</div>
</div>
	<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/common/coreInput-2.0.0.js?v=${FILE_VERSION}"></script>

	<script>
		layui.use(['form', 'element','layer'], function() {
			var form = layui.form;

			form.on('submit(sub)', function(data){
				$ajax({
					url: "/generator/field/edit/save",
					data :  data.field,
			        succCallback: function (json) {
			        	if(json.code == 0){
			        		parent.reload();
		            		parent.layer.closeAll();
		            		parent.layer.msg(json.msg);
			        	}
			        }
				});
				return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
			});
		});

	</script>
</body>
</html>